package softstarter.gui.subareas.settings.adding;

import javax.swing.JButton;

import softstarter.gui.subareas.settings.itemlist.EditableRunnableItem;
import softstarter.launching.RunnableItem;

public class AddableRunnableItem extends EditableRunnableItem {

	private JButton addButton;
	
	
	public AddableRunnableItem(RunnableItem item) {
		super(item);
		
		addButton = new JButton("Add");
		masterContainer.remove(removeButton);
		masterContainer.add(addButton);
	}
	
	public void addAddButtonListener(AddableItemAddListener addListener) {
		
		addButton.addActionListener(addListener);
	}

	public RunnableItem getAddableRunnableItem() {
		item.setName(getValueFromNameField());
		item.setFullPath(getValueFromPathField());
		
		return item;
	}

}
